-- GENERATED SPELL FOR [Wretched Husk] --


function spell0_24690(pUnit, Event) --@Drink Fel Infusion,Self--
pUnit:FullCastSpellOnTarget(44505,pUnit)
pUnit:RegisterEvent('Sorts_24690', 10310, 1)
end

function spell1_24690(pUnit, Event) --@Wretched Fireball,n/a--
pUnit:FullCastSpellOnTarget(44503,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24690', 3000, 1)
end

function spell2_24690(pUnit, Event) --@Wretched Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(44504,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24690', 7000, 1)
end

function Sorts_24690(pUnit, Event)
local choix_sorts_24690 = math.random(0, 2)
if choix_sorts_24690 == 0 then
pUnit:RegisterEvent('spell0_24690', 1, 1)
end
if choix_sorts_24690 == 1 then
pUnit:RegisterEvent('spell1_24690', 1, 1)
end
if choix_sorts_24690 == 2 then
pUnit:RegisterEvent('spell2_24690', 1, 1)
end
end

function mob24690_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24690', math.random(1500, 3000), 1)
end

function mob24690_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24690_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24690_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24690, 1, 'mob24690_Action')
RegisterUnitEvent(24690, 2, 'mob24690_Leave')
RegisterUnitEvent(24690, 3, 'mob24690_Kill')
RegisterUnitEvent(24690, 4, 'mob24690_Die')
